package spring.springbucks.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.support.MessageBuilder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import spring.springbucks.integration.Customer;


@RestController
@RequestMapping("/customer")
@Slf4j
public class CustomerController {


    @Autowired
    private Customer customer;


    @GetMapping("")
    public String getOrder() {
        customer.newOrders().send(MessageBuilder.withPayload("Start waiter").build());

        return "Start waiter";
    }


}

















